import FGDesigner from "./FGDesigner";// 引入封装好的组件
import FGPcForm from "./FGPcForm";// 引入封装好的组件
import FGPcShow from "./FGPcShow";// 引入封装好的组件
import FGPhoneForm from "./FGPhoneForm";// 引入封装好的组件
import FGPhoneShow from "./FGPhoneShow";// 引入封装好的组件


const coms = [FGDesigner, FGPcForm, FGPcShow, FGPhoneForm, FGPhoneShow]; // 将来如果有其它组件,都可以写到这个数组里

import icons from '@/icons' // icon
import utilsComponents from "@/components/formGenerator/utils/component.js"
import componentsAll from "@/components/index.js"
import axios from 'axios';
import * as utils from "@/components/formGenerator/utils/index"
import * as form from "@/components/formGenerator/utils/formEvent"



// 批量组件注册
export default {
  install (app) {
    app.use(icons);
    app.use(componentsAll);

    coms.forEach((com) => {
      app.component(com.name, com);
    });

    utilsComponents.components.forEach(com => {
      com && com.name && app.component(com.name, com)
    })
    app.component('FGDialog', utilsComponents.FGDialog)
    app.config.globalProperties.$axios = axios
    app.config.globalProperties.$utils = utils
    app.config.globalProperties.$form = form
  }
}; // 这个方法以后再使用的时候可以被use调用
